<form name="form1" method="post">
<table width="600" border="0">
  <? /*
  <tr>
    <td >Oficina:</td>
    <td ><?=helpers::combo($conn, '', empty($objeto->id_zona) ? $_SESSION['SesionZona'] :$objeto->id_zona ,'','','id_zona','id','nombre','id_zona','',"SELECT * FROM zonas WHERE id = ". $_SESSION['SesionZona'] . " OR id IN (SELECT id FROM zonas WHERE id_padre =" . $_SESSION['SesionZona'] . ") ORDER BY nombre","CargaUsuarios();","1")?></td>
  </tr>
*/?>

  <tr>
    <td width="100">Perito:</td>
		<td colspan="3" ><?=helpers::combo($conn, '', $objeto->id_perito,'','','id_perito','id','nombre','id_perito','',"SELECT A.* FROM peritos AS A INNER JOIN zonas AS B ON A.id_zona = B.id WHERE A.estatus IN ('A','S') AND B.id = " . $_SESSION['SesionZona'] . " OR B.id_padre = " . $_SESSION['SesionZona'] . " ORDER BY nombre",'','1')?></td>		

<? /*		<td colspan="3" ><?=helpers::combo($conn, '', $objeto->id_perito,'','','id_perito','id','nombre','id_perito','',"SELECT * FROM peritos WHERE id_zona=".$objeto->id_zona." AND estatus='A' ORDER BY nombre",'','1')?></td>		*/?>
   </td>
  </tr>

<tr id="Fecha">
	<td>Fecha:</td>
	<td >
		<table>
			<tr>
				<td><input value="<?=empty($objeto->fecha) ? date("d/m/Y") : muestrafecha($objeto->fecha)?>" name="fecha" id="fecha"  type="text" style="width:80px" /></td> 
				<td > 
					<a href="#" id="boton_fecha" onclick="return false;"><img border="0" src="images/calendarA.png" width="20" height="20" /></a>  
					<script type="text/javascript">
						new Zapatec.Calendar.setup({
								firstDay          : 1,
								weekNumbers       : true,
								showOthers        : false,
								showsTime         : false,
								timeFormat        : "24",
								step              : 2,
								range             : [1900.01, 2999.12],
								electric          : false,
								singleClick       : true,
								inputField        : "fecha",
								button            : "boton_fecha",
								ifFormat          : "%d/%m/%Y",
								daFormat          : "%Y/%m/%d",
								align             : "Br"
							});
					</script>
				</td>
			</tr>
		</table>
	</td>
</tr>

  <tr>
    <td >Concepto:</td>
    <td ><?=helpers::combo($conn, '', $objeto->id_concepto,'','','id_concepto','id','nombre','id_concepto','',"SELECT * FROM conceptos WHERE tipo IN('I','P') ORDER BY nombre",'busca_monto();','true')?>
			<?	$oUsuario = new usuarios;
				if($oUsuario->chequea_permiso($conn, $_SESSION['id'], 'concepto.php')){ 
			?>			
			<input type="button" value="..." onClick="window.open('./concepto.php','popup,height=300,width=300')">
			<input type="button" value="Recargar" onClick="actualiza_conceptos()">
			<? }?>
	</td>
  </tr>
  <tr>
    <td width="100">Cantidad:</td>
    <td>
		<input type="text" name="cantidad" id="cantidad" onClick="click_cantidad();" onBlur="cantidad_defecto();" onChange="busca_monto();" value="<?=empty($objeto->cantidad) ? '1,00': $objeto->cantidad?>">
		<span class="errormsg" id="error_cantidad">*</span>
		<?=$validator->show("error_cantidad")?>
	</td>
  </tr>

  <tr>
    <td width="100">Monto Total:</td>
    <td>
		<input type="text" name="monto" id="monto" onClick="click_monto();" onBlur="monto_defecto();" value="<?=empty($objeto->monto) ? '0,00': $objeto->monto?>">
		<span class="errormsg" id="error_monto">*</span>
		<?=$validator->show("error_monto")?>
	</td>
  </tr>

<tr>
	<td>Descripcion:</td>
	<td colspan="2">
		<textarea name="descripcion" id="descripcion" rows="3" cols="44" ><?=$objeto->descripcion?></textarea>
	</td>
</tr>

<tr>
	<td>Estatus:</td>
	<td colspan="2">
		<input type="text" name="estatus" id="estatus" readOnly="true" value="<?=$objeto->estatus?>">
	</td>
</tr>

</table>

<input style="float:right"  name="accion" type="button" value="<?=$boton?>" onclick="<?=$validator->validate() ?>" />
<input name="id" type="hidden" value="<?=$objeto->id?>" />
<input name="accion" type="hidden" value="<?=$boton?>" /> 
<span style="position:absolute;top:4px;right:5px;cursor:pointer;">
<img onclick="close_div();" src="images/close_div.gif" /></span>
</form>
<p class="errormsg">(*) Campo Requerido</p